/*
 * @description:
 * @Author: lal
 * @Date: 2020-05-19 11:28:43
 * @LastEditors: lal
 * @LastEditTime: 2020-08-22 14:50:39
 */

import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Layout from "../layouts";
Vue.use(VueRouter);

const routes = [
  // {
  //   path: "/",
  //   name: "Home",
  //   component: Home,
  // },
  {
    path: "/",
    component: Layout,
    redirect: "/layout/home",
  },
  {
    path: "/layout",
    component: Layout,
    name: "Layout",
    children: [
      {
        path: "home",
        component: Home,
        name: "Home",
      },
      {
        path: "calc",
        name: "calc",
        component: () => import(/* webpackChunkName: "Calc" */ "../views/Calc.vue"),
      },
      {
        path: "tree",
        name: "Tree",
        component: () => import(/* webpackChunkName: "Tree" */ "../views/Tree.vue"),
      },
    ],
  },
  {
    path: "/calc",
    name: "calc",
    component: () => import(/* webpackChunkName: "about" */ "../views/Calc.vue"),
  },
  {
    path: "/windows",
    name: "Windows",
    component: () => import(/* webpackChunkName: "Windows" */ "../views/Windows.vue"),
  },
  {
    path: "/update",
    name: "Update",
    component: () => import(/* webpackChunkName: "Update" */ "../views/Update.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
